const a = ["a", "b", "c"];
const arrayEntries = a.entries();
for (const [index, element] of arrayEntries) {
  console.log(index, element);
}
// 0 'a'
// 1 'b'
// 2 'c'
